#!/bin/bash

hostname="localhost"
client=""

while getopts ":sch:" opt; do
	case $opt in
		s) cd src; java -classpath ../lib/NAP.jar:../lib/Log4J/log4j-1.2.15.jar drexel.cs544.nap.Main -server; exit 0;;
		
		h) hostname="$OPTARG";;

		c) client="";;
		
		\?) echo "Invalid flag: -$OPTARG" >&2
			exit 1;;
		:)  echo "-$OPTARG needs argument" >&2
			exit 1;;

	esac
done

if [ -z $client ]
then
	cd src; java -classpath ../lib/NAP.jar:../lib/Log4J/log4j-1.2.15.jar drexel.cs544.nap.Main -client $hostname;
fi

